﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GW2_Marketeer
{
	class GWItem
	{
		private string m_sName;
		private string m_sID;
		private int m_nAuctionHousePrice = 0;
		private int m_nMinimumCalculatedPrice = 0;
		private int m_nProfit = 0;
		private double m_nReturnOnInvestment = 0.0;
		private bool m_bCheapestPriceComputed = false;
		private List<string> m_listComponentsRecipe = new List<string>();
		private List<string> m_listShoppingList = new List<string>();
		//List<string> m_listComponentsSalvage;

		public GWItem(string sName)
		{
			m_sName = sName;
		}

		public GWItem(string sName, string sID)
		{
			m_sName = sName;
			m_sID = sID;
		}

        public GWItem(string sName, string sID, IEnumerable<string> sComponents)
        {
            m_sName = sName;
            m_sID = sID;
            m_listComponentsRecipe.AddRange(sComponents);
        }

		public string Name
		{
			get { return m_sName; }
			set { m_sName = value; }
		}
		public string ID
		{
			get { return m_sID; }
			set { m_sID = value; }
		}
		public int AuctionHousePrice
		{
			get { return m_nAuctionHousePrice; }
			set { m_nAuctionHousePrice = value; }
		}
		public int MinimumCalculatedPrice
		{
			get { return m_nMinimumCalculatedPrice; }
			set { m_nMinimumCalculatedPrice = value; }
		}
		public int Profit
		{
			get { return m_nProfit; }
			set { m_nProfit = value; }
		}
		public double ReturnOnInvestment
		{
			get { return m_nReturnOnInvestment; }
			set { m_nReturnOnInvestment = value; }
		}
		public bool CheapestPriceComputed
		{
			get { return m_bCheapestPriceComputed; }
			set { m_bCheapestPriceComputed = value; }
		}

		public void AddComponent(string sComponentName)
		{
			m_listComponentsRecipe.Add(sComponentName);
		}
        
		public int GetNumComponents()
		{
			return m_listComponentsRecipe.Count;
		}
		public string GetComponentAtIndex(int nIndex)
		{
			return m_listComponentsRecipe[nIndex];
		}

		public void AddToShoppingList(string sItemName)
		{
			m_listShoppingList.Add(sItemName);
		}
		public int GetNumShoppingList()
		{
			return m_listShoppingList.Count;
		}
		public string GetShoppingListItemAtIndex(int nIndex)
		{
			return m_listShoppingList[nIndex];
		}
		public void ClearShoppingList()
		{
			m_listShoppingList.Clear();
		}
	}
}
